package com.orphan.marketFront.config;

import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@Configuration
@MapperScan("com.orphan.marketFront.mapper")
@EnableTransactionManagement
public class MybatisPlusConfig {

    @Bean
    public OptimisticLockerInnerInterceptor innerInterceptor(){
        return new OptimisticLockerInnerInterceptor();
    }

    @Bean
    public ISqlInjector iSqlInjector(){
        return new DefaultSqlInjector();
    }
}
